﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Viking
{
    class Rock
    {
        public Vector3 position;
        public Vector3 velocity;
        public bool dead;
        public float maxStrength = 15;
        public float strength;
        public Rock(float power, Vector3 pos, Vector3 throwDirection)
        {
            dead = false;
            strength = power;
            position = pos;
            if (strength > maxStrength)
                strength = maxStrength;
            velocity = strength * throwDirection + new Vector3(0.0f, strength, 0.0f);
            
        }
        public void Update(GameTime gameTime)
        {
            position += velocity * (float)gameTime.ElapsedGameTime.TotalSeconds;
            velocity -= new Vector3(0.0f, 15.0f, 0.0f) * (float)gameTime.ElapsedGameTime.TotalSeconds;
            if (position.Y < 0)
            {
                dead = true;
            }
        }
        public void CollidesWith() // Just a stub for now; this will check to see if the rock is colliding with an enemy/building.
        {
        }
    }
}
